/**   
 * 项目名：phms3
 * 日期：    2019-11-23 10:35:54  
 * Copyright (c) 2015- HTSC-版权所有     
 */

package com.joysuch.wwyt.mh.entity;

import static javax.persistence.GenerationType.IDENTITY;
import java.util.Set;
import java.util.LinkedHashSet;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.EntityListeners;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class})
@Entity
@Table(name = "wwyt_mh_alarm_rule")
@SQLDelete(sql="update wwyt_mh_alarm_rule set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql="update wwyt_mh_alarm_rule set DELETE_FLAG = '1' where id= ?")
@Where(clause="DELETE_FLAG = '0'")

public class MhAlarmRule implements java.io.Serializable{
    
    //columns START
    //ID
    private Long id;
    //租户
    private Long tenentId;
    //组织机构代码
    private String orgCode;
    //
    private Long monitoringPointId;
    //通知级别
    private Integer level;
    //全局配置
    private String defaultConfig;
    //部门限制
    private String deartLimit;
    //创建人
    private Long createBy;
    //创建时间
    private java.time.LocalDateTime createTime;
    //更新人
    private Long updateBy;
    //更新时间
    private java.time.LocalDateTime updateTime;
    //删除标记
    private String deleteFlag;
    //columns END


    public void setId(Long value) {
        this.id = value;
    }
    
    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }
    
     
    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return this.tenentId;
    }
    
    public void setTenentId(Long value) {
        this.tenentId = value;
    }
    
     
    @Column(name = "ORG_CODE", length = 100)
    public String getOrgCode() {
        return this.orgCode;
    }
    
    public void setOrgCode(String value) {
        this.orgCode = value;
    }
    
     
    @Column(name = "MONITORING_POINT_ID")
    public Long getMonitoringPointId() {
        return this.monitoringPointId;
    }
    
    public void setMonitoringPointId(Long value) {
        this.monitoringPointId = value;
    }
    
     
    @Column(name = "LEVEL")
    public Integer getLevel() {
        return this.level;
    }
    
    public void setLevel(Integer value) {
        this.level = value;
    }
    
     
    @Column(name = "DEFAULT_CONFIG", length = 2)
    public String getDefaultConfig() {
        return this.defaultConfig;
    }
    
    public void setDefaultConfig(String value) {
        this.defaultConfig = value;
    }
    
     
    @Column(name = "DEART_LIMIT", length = 2)
    public String getDeartLimit() {
        return this.deartLimit;
    }
    
    public void setDeartLimit(String value) {
        this.deartLimit = value;
    }
    
     
    @org.springframework.data.annotation.CreatedBy
    @Column(name = "CREATE_BY")
    public Long getCreateBy() {
        return this.createBy;
    }
    
    public void setCreateBy(Long value) {
        this.createBy = value;
    }
    
     
    @org.springframework.data.annotation.CreatedDate
    @Column(name = "CREATE_TIME")
    public java.time.LocalDateTime getCreateTime() {
        return this.createTime;
    }
    
    public void setCreateTime(java.time.LocalDateTime value) {
        this.createTime = value;
    }
    
     
    @org.springframework.data.annotation.LastModifiedBy
    @Column(name = "UPDATE_BY")
    public Long getUpdateBy() {
        return this.updateBy;
    }
    
    public void setUpdateBy(Long value) {
        this.updateBy = value;
    }
    
     
    @org.springframework.data.annotation.LastModifiedDate
    @Column(name = "UPDATE_TIME")
    public java.time.LocalDateTime getUpdateTime() {
        return this.updateTime;
    }
    
    public void setUpdateTime(java.time.LocalDateTime value) {
        this.updateTime = value;
    }
    
     
    @Column(name = "DELETE_FLAG", length = 2)
    public String getDeleteFlag() {
        return this.deleteFlag;
    }
    
    public void setDeleteFlag(String value) {
        this.deleteFlag = value;
    }
    

    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id",getId())
            .append("tenentId",getTenentId())
            .append("orgCode",getOrgCode())
            .append("monitoringPointId",getMonitoringPointId())
            .append("level",getLevel())
            .append("defaultConfig",getDefaultConfig())
            .append("deartLimit",getDeartLimit())
            .append("createBy",getCreateBy())
            .append("createTime",getCreateTime())
            .append("updateBy",getUpdateBy())
            .append("updateTime",getUpdateTime())
            .append("deleteFlag",getDeleteFlag())
            .toString();
    }
    
    public int hashCode() {
        return new HashCodeBuilder()
            .append(getId())
            .toHashCode();
    }
    
    public boolean equals(Object obj) {
        if(obj instanceof MhAlarmRule == false) return false;
        if(this == obj) return true;
        MhAlarmRule other = (MhAlarmRule)obj;
        return new EqualsBuilder()
            .append(getId(),other.getId())
            .isEquals();
    }
}

